package src.multithreading;

public class YieldTest {

    public static void main(String[] args){
        MyYield myYield = new MyYield();

        new Thread(myYield,"thread-A").start();
        new Thread(myYield,"thread-B").start();
    }
}
class MyYield implements Runnable{
    @Override
    public void run(){
        System.out.println(Thread.currentThread().getName()+"-->start");
        /*Thread.yield();*/
        System.out.println(Thread.currentThread().getName()+"-->over");
    }
}
